/****************************************************************************************************
* 版权所有： Copyright (c) 2015-2022 鑫光家纺. All rights reserved.
* 作    者： 半   饱
* 创建日期： 2022/8/8
* 界面功能： <#界面功能#>
****************************************************************************************************/

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

/// 计算屏幕尺寸比率 基数是 375 *750屏
#ifndef BBAlertView_Scale
#define BBAlertView_Scale [UIScreen mainScreen].bounds.size.width / 375.f
#endif

/// 按比率计算尺寸大小。基数是 375 *750屏
#ifndef BBAlertView_Relative
#define BBAlertView_Relative(a)      M_G_Scale * a
#endif

/// 判断是否是流海屏
#ifndef BBAlertView_IsBangsScreen
#define BBAlertView_IsBangsScreen ({\
    BOOL isBangsScreen = NO; \
    if (@available(iOS 11.0, *)) { \
    UIWindow *window = [[UIApplication sharedApplication].windows firstObject]; \
    isBangsScreen = window.safeAreaInsets.bottom > 0; \
    } \
    isBangsScreen; \
})
#endif


NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger,BBAlertActionType) {
    BBAlertActionTypeDefault,//按插入顺序
    BBAlertActionTypeCustom,//需要自已关闭弹框
    BBAlertActionTypeCancel,//总是显示在最左边
    /// 外部控制的按钮（暂时无用）
    BBAlertActionTypeExternal//外部按钮
};

typedef NS_ENUM(NSInteger,BBAlertTextAlignment)  {
    BBAlertTextAlignmentLeft      = 0,
#if TARGET_ABI_USES_IOS_VALUES
    BBAlertTextAlignmentCenter    = 1,
    BBAlertTextAlignmentRight     = 2,
#else /* !TARGET_ABI_USES_IOS_VALUES */
    BBAlertTextAlignmentRight     = 1,
    BBAlertTextAlignmentCenter    = 2,
#endif
    BBAlertTextAlignmentDefault = BBAlertTextAlignmentCenter
};

/// 按钮方向，目前只适配与AlertView
typedef NS_ENUM(NSInteger,BBActionDirection)  {
    BBActionDirectionDefault,//默认方向为：水平方向
    BBActionDirectionHorizontal = BBActionDirectionDefault, /// 水平方向
    BBActionDirectionVertical //垂直方向
};

/// Alert/SheetView基础配置
@interface BBAlertConfiguration : NSObject

/// 整个AlertView背景图片，默认值为：nil
@property (nonatomic,strong) UIImage *alertViewBackgroundImage;

/// 整个AlertView背景色，默认值为：whiteColor
@property (nonatomic,strong) UIColor *alertViewBackgroundColor;

/// AlertView居左边间距，AlertView默认值为：50.f ，AlertSheet默认值为：0.f
@property (nonatomic,assign) CGFloat alertViewLeftSpace;

/// AlertView居右边间距，AlertView默认值为：50.f，AlertSheet默认值为：0.f
@property (nonatomic,assign) CGFloat alertViewRightSpace;

/// 整个AlertView的圆角大小设置，默认为：8.f
@property (nonatomic,assign) CGFloat cornerRadius;

/// Title背景色，默认值为：whiteColor(暂时没有使用)
@property (nonatomic,strong) UIColor *titleBackgroundColor;

/// Title背景图，默认值为：nil(暂时没有使用)
@property (nonatomic,strong) UIImage *titleBackgroundImage;

/// message背景色，默认值为：whiteColor(暂时没有使用)
@property (nonatomic,strong) UIColor *messageBackgroundColor;

/// message背景图，默认值为：nil(暂时没有使用)
@property (nonatomic,strong) UIImage *messageBackgroundImage;

/// 标题字体，默认值为：粗体 18号字
@property (nonatomic,strong) UIFont *titleFont;

/// 标题颜色，默认值为：0x222222
@property (nonatomic,strong) UIColor *titleColor;

/// 标题对齐方式，默认值为：BBAlertTextAlignmentCenter
@property (nonatomic,assign) BBAlertTextAlignment titleTextAlignment;

/// 信息字体，默认值为：常规16号字
@property (nonatomic,strong) UIFont *messageFont;

/// 信息色值，默认值为：0x222222
@property (nonatomic,strong) UIColor *messageColor;

/// 信息行间距
@property (nonatomic,assign) CGFloat messageLineSpace;

/// 信息显示行数，默认值为：NSIntegerMax
@property (nonatomic,assign) NSUInteger messageLineCount;

/// 信息对齐方式，默认值为：BBAlertTextAlignmentCenter
@property (nonatomic,assign) BBAlertTextAlignment messageTextAlignment;

/// 横向分隔线的高度，默认值为：0.5f，AlertSheet时为取消按钮上面的线，默认为：10
@property (nonatomic,assign) CGFloat acrossHeight;

/// 横向分隔线的色值，默认值为：0xeeeeee，AlertSheet时为取消按钮上面的线，默认为：0xeeeeee
@property (nonatomic,strong) UIColor *acrossColor;

/// 横向分隔线是否隐藏，AlertView默认值为：NO ，AlertSheet时为取消按钮上面的线，默认为：NO
@property (nonatomic,assign) BOOL acrossHidden;

/// 垂直分隔线的宽度，AlertView默认值为：0.5f，AlertSheet默认值为：0.5f
@property (nonatomic,assign) CGFloat verticalWidth;

/// 垂直分隔线的色值，默认值为：0xeeeeee ，AlertSheet时为每个按钮之间的线，默认为：0xeeeeee
@property (nonatomic,strong) UIColor *verticalColor;

/// 垂直分隔线是否隐藏，默认值为：NO ，AlertSheet时为每个按钮之间的线，默认为NO
@property (nonatomic,assign) BOOL verticalHidden;

/// 下面按钮高度，AlertView默认值为：51.f,AlertSheet时为每个操作按扭的高度
@property (nonatomic,assign) CGFloat actionHeight;

/// Default按钮字体颜色，默认值为：0x333333
@property (nonatomic,strong) UIColor *typeDefaultColor;

/// Default按钮字体，默认值为：粗体，16号默认字体
@property (nonatomic,strong) UIFont *typeDefaultFont;

/// Default按钮背景色，默认值为：[UIColor clearColor]
@property (nonatomic,strong) UIColor *typeDefaultBackgroundColor;

/// Default按钮背景图，默认值为：nil
@property (nonatomic,strong) UIImage *typeDefaultBackgroundImage;

/// Cancel按钮字体颜色，默认值为：0x999999
@property (nonatomic,strong) UIColor *typeCancelColor;

/// Cancel按钮字体，默认值为：粗体，16号默认字体
@property (nonatomic,strong) UIFont *typeCancelFont;

/// Cancel按钮背景色，默认值为：[UIColor clearColor]
@property (nonatomic,strong) UIColor *typeCancelBackgroundColor;

/// Cancel按钮背景图，默认值为：nil
@property (nonatomic,strong) UIImage *typeCancelBackgroundImage;

/// Custom按钮字体颜色，默认值为：0x333333
@property (nonatomic,strong) UIColor *typeCustomColor;

/// Custom按钮字体，默认值为：粗体，16号默认字体
@property (nonatomic,strong) UIFont *typeCustomFont;

/// Custom按钮背景色，默认值为：[UIColor clearColor]
@property (nonatomic,strong) UIColor *typeCustomBackgroundColor;

/// Custom按钮背景图，默认值为：nil
@property (nonatomic,strong) UIImage *typeCustomBackgroundImage;

/// 按钮图标大小设置，目前只有统一尺寸，不区分按钮，默认为：24*24
@property (nonatomic,assign) CGSize actionImageSize;

/// 统一设置Action的边距，默认值为：0.f，0.f，0.f，0.f
@property (nonatomic,assign) UIEdgeInsets actionEdgeInsets;

/// 统一设置Action的圆角，默认值为：0.f
@property (nonatomic,assign) CGFloat  actionCornerRadius;

#pragma mark - 2022-08-22新增
/// 事件按钮间距
@property (nonatomic,assign) CGFloat actionSpace;

@property (nonatomic,strong) UIColor *cancelBorderColor;

@property (nonatomic,assign) CGFloat cancelBorderWidth;

@property (nonatomic,strong) UIColor *defaultBorderColor;

@property (nonatomic,assign) CGFloat defaultBorderWidth;

@property (nonatomic,strong) UIColor *customBorderColor;

@property (nonatomic,assign) CGFloat customBorderWidth;

/// 事件按钮方向
@property (nonatomic,assign) BBActionDirection actionDirection;

+  (instancetype)defaultAlertViewConfiguration;


+  (instancetype)defaultAlertSheetConfiguration;

@end

NS_ASSUME_NONNULL_END
